Skip to content

[4/5] Use remote-aware skill locations in UI consumers#11581

Merged
moirahuang merged 2 commits into
masterfrom
moira/skills-ui-consumers
May 30, 2026
Merged

[4/5] Use remote-aware skill locations in UI consumers#11581
moirahuang merged 2 commits into
masterfrom
moira/skills-ui-consumers

Conversation

@moirahuang
Copy link
Copy Markdown
Contributor

@moirahuang moirahuang commented May 22, 2026

Description

PR 4/5 of the remote-aware skills stack.

Propagate LocalOrRemotePath skill locations through UI consumers and explicit open actions so the UI does not collapse remote skills before reaching the location-sensitive boundary.

Plan: https://staging.warp.dev/drive/notebook/EAngN0Hb9BqY5WiPMTXFV5
Agent run: https://staging.warp.dev/conversation/88702634-8ffe-46a4-b868-1efae92630eb

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • cargo fmt --manifest-path Cargo.toml -p warp_util -p ai -p warp

  • cargo test -p warp test_skill_path_from_file_path --lib (run on this layer before the top-layer obsolete helper removal)

  • Full workspace clippy was started on the cumulative stack tip but not completed before submission.

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Oz oz-agent@warp.dev

Copy link
Copy Markdown
Contributor Author

moirahuang commented May 22, 2026

@moirahuang moirahuang changed the base branch from moira/skills to graphite-base/11581 May 23, 2026 00:39
@moirahuang moirahuang force-pushed the graphite-base/11581 branch from e82963e to 8ac561a Compare May 29, 2026 00:27
@moirahuang moirahuang force-pushed the moira/skills-ui-consumers branch from aa6466d to 278c688 Compare May 29, 2026 00:27
@moirahuang moirahuang changed the base branch from graphite-base/11581 to moira/skills-hydration May 29, 2026 00:27
@moirahuang moirahuang marked this pull request as ready for review May 29, 2026 00:27
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 29, 2026

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@moirahuang moirahuang changed the title Use remote-aware skill locations in UI consumers [4/5] Use remote-aware skill locations in UI consumers May 29, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates skill UI consumers to use remote-aware working directories and skill locations across AI output, slash command, and code diff surfaces.

Concerns

  • The diff introduces build-breaking type/import issues in the remote-aware skill lookup paths.
  • The code diff header can show an Open Skill button for mixed diffs because non-skill files are dropped before checking whether all files share the same skill.
  • This is user-facing UI behavior, but the PR description does not include screenshots or a screen recording demonstrating it end to end.

Verdict

Found: 3 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz


/// Get the current working directory from the active session
fn get_current_working_directory(&self, app: &AppContext) -> Option<PathBuf> {
fn get_current_working_directory(&self, app: &AppContext) -> Option<LocalOrRemotePath> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [CRITICAL] This signature now references LocalOrRemotePath, but the diff removes the existing path import and does not add warp_util::local_or_remote_path::LocalOrRemotePath, so this file will not compile. Add the import or qualify the type.

common_path(&file_paths)
.and_then(|common| skill_path_from_file_path(&common))
.and_then(|skill_path| {
SkillManager::as_ref(app).skill_by_path(&LocalOrRemotePath::Local(skill_path))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [CRITICAL] skill_path_from_file_path returns a local PathBuf, but this wraps it in LocalOrRemotePath before calling skill_by_path; the existing lookup accepts a path key, so this call will not type-check. Keep this as skill_by_path(&skill_path) unless the manager API is changed in this PR.

skill_paths
.iter()
.all(|path| path == first_path)
.then(|| SkillManager::as_ref(app).skill_by_path(first_path))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [CRITICAL] first_path is a LocalOrRemotePath, but skill_by_path looks up parsed skills by path, so this call will not type-check with the current manager API. Convert back to the manager's key type or update the manager API consistently in this PR.

.to_local_path()
.map(|path| (skill, path.to_path_buf()))
}) {
let skill_paths = file_locations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] filter_map drops files that are not inside a skill directory, so a diff containing one skill file plus unrelated files still passes the all(|path| path == first_path) check and renders the Open Skill button. Require every file_location to resolve to the same skill path before showing the button.

@moirahuang moirahuang requested a review from kevinyang372 May 29, 2026 00:44
@moirahuang moirahuang force-pushed the moira/skills-ui-consumers branch from 278c688 to 5f6fa32 Compare May 29, 2026 19:56
@moirahuang moirahuang force-pushed the moira/skills-hydration branch from 436ae71 to 1b2b511 Compare May 29, 2026 19:56
self.location_for_standardized_path(diff.diff_view.as_ref(app).file_path()?)
})
.collect();
let file_paths: Vec<PathBuf> = file_locations
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using PathBuf here? This assumes local OS encoding no (which is not what we want)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, switched to using file_locations which is a LocalOrRemotePath

Base automatically changed from moira/skills-hydration to moira/skills-api-references May 29, 2026 22:38
@moirahuang moirahuang force-pushed the moira/skills-ui-consumers branch 2 times, most recently from 8b5d0c1 to 783e4a5 Compare May 29, 2026 23:17
@moirahuang moirahuang force-pushed the moira/skills-api-references branch 2 times, most recently from 353bb62 to b8fa2dc Compare May 29, 2026 23:59
@moirahuang moirahuang force-pushed the moira/skills-ui-consumers branch from 783e4a5 to f7c7e76 Compare May 29, 2026 23:59
Base automatically changed from moira/skills-api-references to master May 30, 2026 00:16
@moirahuang moirahuang marked this pull request as draft May 30, 2026 00:19
@moirahuang moirahuang marked this pull request as ready for review May 30, 2026 00:19
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 30, 2026

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR propagates LocalOrRemotePath through skill UI entry points and adds remote project-skill hydration paths for the skill watcher.

Concerns

  • Read/search result skill detection still re-wraps discovered paths as local paths, so remote project skills keyed by LocalOrRemotePath::Remote will not resolve in those UI consumers.
  • This is a user-facing UI/behavior change, but the PR description does not include screenshots or a screen recording demonstrating the remote skill UI paths working end to end.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

common_path(&file_paths)
.and_then(|common| skill_path_from_file_path(&common))
.and_then(|skill_path| {
SkillManager::as_ref(app).skill_by_path(&LocalOrRemotePath::Local(skill_path))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This helper still forces every detected skill path into LocalOrRemotePath::Local, so read/search results from a remote session will not match skills cached under remote paths. Thread the session's remote location/host into this lookup or suppress the button until a remote-aware location is available.

moirahuang and others added 2 commits May 30, 2026 00:35
@moirahuang moirahuang force-pushed the moira/skills-ui-consumers branch from f7c7e76 to 9152f13 Compare May 30, 2026 00:35
Copy link
Copy Markdown
Contributor Author

moirahuang commented May 30, 2026

Merge activity

  • May 30, 12:36 AM UTC: Graphite rebased this pull request as part of a merge.
  • May 30, 12:46 AM UTC: Graphite couldn't merge this PR because it was in draft mode.

@moirahuang moirahuang marked this pull request as draft May 30, 2026 00:46
@moirahuang moirahuang marked this pull request as ready for review May 30, 2026 00:46
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 30, 2026

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR propagates remote-aware skill locations through several UI consumers, including code-diff open-skill actions and slash-command skill discovery. I did not find diff-backed security issues in the changed hunks, and the attached spec context reports no approved spec for comparison.

Concerns

  • ⚠️ [IMPORTANT] This is a user-facing UI/behavior change: it changes when skill badges/buttons appear and how slash-command skill discovery behaves in remote-aware contexts. The PR description has no attached screenshots or screen recording, so reviewers cannot verify the end-to-end UI behavior. For this user-facing change, please include screenshots or a short recording demonstrating it working end to end.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@moirahuang moirahuang merged commit 74d2566 into master May 30, 2026
41 of 45 checks passed
@moirahuang moirahuang deleted the moira/skills-ui-consumers branch May 30, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants